import { baseUrl, preUrl, inspectitemUploadTemplateUrl, dailyUrl, formUrl, zhizhouUrl, userUrl, questionnaireUrl, backstageUrl } from "./config.js";
import Axios from "axios";
import {
    Layout, Menu, Icon, Table, Divider, Button, Modal, Form, Input, DatePicker,
    Select, Popconfirm, message, Alert, TreeSelect, TimePicker, Tree,
    AutoComplete, Tabs, Col, Row, Dropdown, Card, Pagination, Spin, Skeleton,
    Drawer, Tag, Badge, Radio, Steps, Transfer, notification, Empty, Calendar, Checkbox, Upload, List, Avatar
} from "antd";
import Cookie from 'js-cookie'
import * as echarts from "echarts"
import React, { Component } from "react";
import JSEncrypt from 'jsencrypt'
import moment from 'moment';


Axios.defaults.withCredentials = true;
// function toLogin(){
//     window.location.href="http://localhost:3000"
// }
function toLogin(){
    window.location.href="http://47.111.158.147:3000"
}

//本地
// Axios.interceptors.response.use(

//     res => {

        

//         console.log('==========1', res);
//         console.log('==========2', document.cookie);

//         if (res.config.url == "http://localhost:9527/huan/user/SystemLogin/getPublicKey") {
//             console.log("getPublicKey===============")
//         }else if (res.config.url == "http://localhost:9527/huan/user/SystemLogin/login") {
//             console.log("login===============")
//         } else if(res.config.url == "http://localhost:9527/huan/user/SystemLogin/logOut"){
//             console.log("logOut===============")
//         }
//         else if(res.config.url.indexOf("weChatSystem") != -1){
//             console.log("weChatSystem方法==========")
//         }
//         else if (res.data.result != "userError" && document.cookie == "") {
//             console.log("会话超时======")
//             if (res.config.url.indexOf("bigscreenSecurity") != -1) {
//                 console.log("res===========", res)
//                 console.log("bigscreenSecurit方法====")
//                 document.cookie = 'COOKIE_TEMP' + 'd09b9a51-b471-4759-b5f0-1e743c1b5950';
//             } else {
//                 // console.log("进入退出操作=====")
//                 message.destroy();
//                 message.success("会话超时，需要重新登录", 1).then(() => toLogin())
//             }
//         } else if(Cookie.get("_COOKIE_NAME") == undefined) {
//             console.log('登录失效==========');
//             message.destroy();
//             message.success("会话超时，需要重新登录", 1).then(() => toLogin())
//         }
//         return res;
//     },
// )

//线上
Axios.interceptors.response.use(

    res => {

        

        console.log('==========1', res);
        console.log('==========2', document.cookie);

        if (res.config.url == "http://47.111.158.147:9527/huan/user/SystemLogin/getPublicKey") {
            console.log("getPublicKey===============")
        }else if (res.config.url == "http://47.111.158.147:9527/huan/user/SystemLogin/login") {
            console.log("login===============")
        } else if(res.config.url == "http://47.111.158.147:9527/huan/user/SystemLogin/logOut"){
            console.log("logOut===============")
        }
        else if(res.config.url.indexOf("weChatSystem") != -1){
            console.log("weChatSystem方法==========")
        }
        else if (res.data.result != "userError" && document.cookie == "") {
            console.log("会话超时======")
            if (res.config.url.indexOf("bigscreenSecurity") != -1) {
                console.log("res===========", res)
                console.log("bigscreenSecurit方法====")
                document.cookie = 'COOKIE_TEMP' + 'd09b9a51-b471-4759-b5f0-1e743c1b5950';
            } else {
                // console.log("进入退出操作=====")
                message.destroy();
                message.success("会话超时，需要重新登录", 1).then(() => toLogin())
            }
        } else if(Cookie.get("_COOKIE_NAME") == undefined) {
            console.log('登录失效==========');
            message.destroy();
            message.success("会话超时，需要重新登录", 1).then(() => toLogin())
        }
        return res;
    },
)



class Test extends Component {
    render() {
        return (
            <div>
                <Alert
                    message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text"
                    type="warning"
                    closable

                />
                <Alert
                    message="Error Text"
                    description="Error Description Error Description Error Description Error Description Error Description Error Description"
                    type="error"
                    closable

                />
            </div>
        )
    }
}




// Axios.headers("Access-Control-Allow-Origin", "*")

// export let loginApi = (username, password) => {
//     return (
//         Axios.get(baseUrl + "SystemLogin/login", {
//             params: {
//                 username: username,
//                 password: password
//             }
//         })
//     );
// };

export let loginApi = (username, password) => {
    return (
        Axios.post(userUrl + "SystemLogin/login", {
            username: username,
            password: password
        })
    );
};

export let getPublickeyApi = () => {
    return (
        Axios.post(userUrl + "SystemLogin/getPublicKey", {
        })
    );
};


//新增跳转到调查问卷系统请求
// export let loginApiToSurvey = (username, password, schoolId) => {
//     return (
//         Axios.post(baseUrlSurvey+"login", {
//                 account: username,
//                 password: password,
//                 schoolId: schoolId 
//         })
//     );
// }

export let allUserApi = (identity, department) => {
    return (
        Axios.post(userUrl + "AccountManagement/getAllValidUser", {
            identity: identity,
            department: department
        })
    );
}

export let allDepartmentApi = (usertype) => {
    if (usertype == "教育局用户") {
        return (
            allEduDepartmentApi()
        );
    }
    if (usertype == "学校用户") {
        return (
            allSchoolApi()
        );
    }
    if (usertype == undefined) {
        return Axios.get(userUrl + "permission/listAllDepartment")
    }
}

export let addUserApi = (params) => {
    return (
        Axios.post(userUrl + "AccountManagement/addUser", {
            username: params.userName,
            password: params.password,
            realName: params.realName,
            phone: params.phone,
            identity: params.identity,
            department: params.department
        })
    );
}

export let deleteUserApi = (username) => {
    return (
        Axios.post(userUrl + "AccountManagement/deleteUser", {
            username: username
        })
    );
}

export let updateUserApi = (username, params) => {
    return (
        Axios.post(userUrl + "AccountManagement/updateUser", {
            username: username,
            password: params.password,
            realName: params.realName,
            phone: params.phone,
            identity: params.identity,
            department: params.department
        })
    );
}

export let allSchoolApi = () => {
    return (
        Axios.get(userUrl + "schoolMangement/getAllValidSchool")
    );
}

export let deleteSchoolAip = (schoolname) => {
    return (
        Axios.post(userUrl + "schoolMangement/deleteSchool", {
            name: schoolname
        })
    );
}

export let allIdentityApi = (usertype, departmentId) => {
    if (usertype == "教育局用户") {
        return (
            Axios.post(userUrl + "AccountManagement/getAllIdentityForEdu", {
                department: departmentId
            })
        );
    }
    if (usertype == "学校用户") {
        return (
            Axios.post(userUrl + "AccountManagement/getAllIdentityForSchool", {
                department: departmentId
            })
        );
    }
}

export let addSchoolApi = (params) => {
    return (
        Axios.post(userUrl + "schoolMangement/addSchool", {
            name: params.schoolname,
            address: params.address,
            parent: params.department
        })
    );
}
//批量增加用户信息
export let uploadUserInfo = (formData) => {
    return (
        Axios({
            method: 'post',
            url: userUrl + 'AccountManagement/uploadUserInfo',
            headers: { "Content-Type": "multipart/form-data" },
            processData: false,
            data: formData
        })
    );
}

//批量增加学校
export let addMultiSchools = (formData) => {
    return (
        Axios({
            method: 'post',
            url: userUrl + 'schoolMangement/addMultiSchools',
            headers: { "Content-Type": "multipart/form-data" },
            processData: false,
            data: formData
        })
    );
}
//批量增加学校默认角色
export let addSchoolDefaultRoles = (schoolIdAndNameList) => {
    return (
        Axios.post(userUrl + "schoolMangement/addSchoolDefaultRoles", {
            schoolIdAndNameList: schoolIdAndNameList
        })
    );
}
//给学校插入默认uuid
export let insertUuidApi=(schoolId)=>{
    return(
        Axios.post(userUrl+"schoolMangement/insertUuid", {
            schoolId:schoolId
        })
    );
}
//获取所有未分配权限的学校
export let getAllUnRoleSchool = () => {
    return (
        Axios.post(userUrl + "schoolMangement/getAllUnRoleSchool", {

        })
    );
}

export let updateSchoolApi = (schoolname, params) => {
    return (
        Axios.post(userUrl + "schoolMangement/updateSchool", {
            name: params.schoolname, //修改后的学校名
            address: params.address,
            parent: params.department,
            param: schoolname //需要修改学校名
        })
    );
}

export let allEduDepartmentApi = (id) => {
    return (
        Axios.get(userUrl + "eduDepartmentManagement/getAllValidEduDepartment", {
            params: {
                id: id,
            }
        })
    );
}

export let getAllMunicipalityApi = (id) => {
    return (
        Axios.get(userUrl + "eduDepartmentManagement/getAllMunicipality", {
            params: {
                id: id,
            }
        })
    );
}

export let deleteEduDepartmentApi = (edudepartmentName) => {
    return (
        Axios.post(userUrl + "eduDepartmentManagement/deleteEduDepartment", {
            name: edudepartmentName
        })
    );
}

export let addEduDepartmentApi = (params) => {
    return (
        Axios.post(userUrl + "eduDepartmentManagement/addEduDepartment", {
            name: params.edudepartmentname,
            address: params.address,
            parent: params.department
        })
    );
}

export let updateEduDepartmentApi = (edudepartmentname, params) => {
    return (
        Axios.post(userUrl + "eduDepartmentManagement/updateEduDepartment", {
            name: params.edudepartmentname, //修改后的
            address: params.address,
            param: edudepartmentname, //需要修改
            parent: params.department
        })
    );
}

export let checkpointBySchoolApi = (school) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getThisSchoolCheckpoint", {
            schoolId: school,
        })
    );
}

export let addCheckPointApi = (school, values) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/addCheckpoint", {
            schoolId: school,
            type: values.type,
            address: values.address,
            macAddress: values.macAddress,
        })
    );
}

export let updateCheckPointApi = (id, school, values, type) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/updateCheckpoint", {
            id: id,
            schoolId: school,
            address: values.address,
            newType: values.type,
            type: type
        })
    );
}

export let deleteCheckPointApi = (id, school, type) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteCheckpoint", {
            id: id,
            schoolId: school,
            type: type
        })
    );
}

export let getInspectItemPointRelationBySchoolApi = (school) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getInspectitempointrelationSelect", {
            schoolId: school,
        })
    );
}

export let getInspectItemPointRelationDetailByCheckpointIdApi = (checkpointId, school) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getCategoryAndItemByCheckpointId", {
            checkpointId: checkpointId,
            schoolId: school
        })
    );
}

export let deleteInspectItemPointRelationApi = (checkpointId, school) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/deleteInspectitempointrelation", {
            checkPointId: checkpointId,
            schoolId: school,
        })
    );
}

export let deleteInspectItemPointRelationByRelationIdApi = (id, school) => { //id是表里的id,单删
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/deleteInspectitemPointRelationByRelationId", {
            id: id,
            schoolId: school,
        })
    );
}

export let allCheckItemApi = () => {
    return (
        Axios.get(backstageUrl + "schoolSafetySupervisor/getAllInspectitem")
    );
}

export let addInspectItemPointRelationApi = (checkPoint, checkItem, schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/addInspectItemPointRelationTest", {
            checkItem: checkItem,
            checkpointId: checkPoint,
            schoolId: schoolId
        })
    );
}

export let getInspectItemFromManualWithTree = (schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getInspectItemFromInspectitemSelfDefined", {
            schoolId: schoolId
        })
    );
}

export let getInspectItemCheckpointRelationByCheckpointIdWithTree = (checkpointId, schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getInspectItemCheckpointRelationWithTree", {
            checkpointId: checkpointId,
            schoolId: schoolId,
        })
    );
}

export let updateInspectItemCheckpointRelation = (checkpointId, values, schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/updateInspectItemPointRelation", {
            checkpointId: checkpointId,
            checkItem: values,
            schoolId: schoolId,
        })
    );
}

export let patrolPlanBySchoolApi = (school) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getAllPatrolPlan", {
            schoolId: school,
        })
    );
}

export let deletePatrolPlanApi = (id, school) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/deletePatrolPlan", {
            id: id,
            schoolId: school
        })
    );
}

export let updatePatrolPlanApi = (id, values) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/updatePatrolPlan", {
            id: id,
            startTime: values.startTime, //需要修改
            endTime: values.endTime,
            classId: values.teamId,
            schoolId: values.schoolId
        })
    );
}

export let addPatrolPlanApi = (values) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/addPatrolPlan", {
            schoolId: values.schoolId,
            startTime: values.startTime, //需要修改
            endTime: values.endTime,
            should: values.should,
            classId: values.teamId
        })
    );
}

export let teamOptionsBySchoolAndType = (school, type) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getClassOptionsBySchoolAndType", {
            schoolId: school,
            type: type
        })
    );
}

export let inspectPlanMakeClassBySchoolApi = (school) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getAllInspectPlanMakeClass", {
            schoolId: school,
        })
    );
}

export let inspectPlanMakeByClassIdApi = (school, classId) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getAllInspectMakeByClass", {
            schoolId: school,
            classId: classId
        })
    );
}

export let addInspectPlanApi = (school, classId, teamName, startDate, endDate, cycle, checkItem, checkpointId, checkpoint) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/addInspectPlanMake", {
            schoolId: school,
            classId: classId,
            teamName: teamName,
            startDate: startDate,
            endDate: endDate,
            cycle: cycle,
            checkItem: checkItem,
            checkpointId:checkpointId,
            address:checkpoint
        })
    );
}
export let updateAndAddInspectPlanApi = (school, classId, startDate, endDate, cycle, checkItem, checkpointId, symbol) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/updateAndAddInspectPlan", {
            schoolId: school,
            classId: classId,
            startDate: startDate,
            endDate: endDate,
            cycle: cycle,
            checkItem: checkItem,
            checkpointId:checkpointId,
            symbol:symbol
        })
    );
}

export let getItemWithTreeForAddInspectPlanApi = (schoolId, classId, checkpointId) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getItemWithTreeForAddInspectPlan", {
            schoolId: schoolId,
            classId: classId,
            checkpointId: checkpointId,
        })
    );
}
//新增巡检内容
export let getInspectItemContentTree = (schoolId, checkedKeys) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getInspectItemContentTree", {
            schoolId: schoolId,
            checkItem: checkedKeys,
        })
    );
}

export let deleteInspectPlanBySymbolApi = (school, symbol, teamId, checkpointId) => {
    console.log(checkpointId)
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/deleteInspectPlanAndMakeAndItemAndPoint", {
            schoolId: school,
            symbol: symbol,
            classId: teamId,
            checkpointId: checkpointId
        })
    );
}

export let updateInspectPlanApi = (classId, checkpointId, symbol, checkItem, school) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/updateInspectPlan", {
            classId: classId,
            checkpointId: checkpointId,
            symbol: symbol,
            inspectitempointrelationId: checkItem,
            schoolId: school,
        })
    );
}

export let getInspectPlanItemBySymbol = (checkpointId, symbol, classId, school) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getInspectPlanItemBySymbol", {
            schoolId: school,
            symbol: symbol,
            checkpointId: checkpointId,
            classId: classId,
        })
    );
}
export let getInspectPlanItemAndContentUpdate = (schoolId, symbol, checkedKeys) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getInspectPlanItemAndContentUpdate", {
            schoolId: schoolId,
            symbol:symbol,
            checkItem: checkedKeys,
        })
    );
}

export let allCategoryItemApi = () => {
    return (
        Axios.get(backstageUrl + "schoolSafetySupervisor/getAllCategoryItem")
    );
}


export let allCategoryApi = () => {
    return (
        Axios.get(backstageUrl + "schoolSafetySupervisor/getAllCategory")
    );
}

export let allInspectItemCategory = (schoolId, identityId) => {
    return (
        Axios.post(zhizhouUrl + "WeChat/weChatSystem/getAllValidInspectItems", {
            schoolId: schoolId
        })
    );
}

export let checkConditionBySchoolApi = (schoolId, startDate, endDate, patrolPeople) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getCheckConditionBySchool", {
            schoolId: schoolId,
            startDate: startDate,
            endDate: endDate,
            patrolPeople: patrolPeople,
        })
    );
}

export let punchCardDetialBySymbolApi = (schoolId, symbol) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getCheckConditionBySymbol", {
            schoolId: schoolId,
            symbol: symbol,
        })
    );
}


export let dataForDrawPunchCardApi = (values) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getAllInspectPlan", {
            cycle: values.cycle,
            startTime: values.startTime,
            endTime: values.endTime,
        })
    );
}

export let allTeamBySchoolApi = (school) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getAllClass", {
            schoolId: school,
        })
    );
}

export let deleteTeamApi = (id) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/deleteClass", {
            id: id,
        })
    );
}

export let addTeamApi = (school, values) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/addClass", {
            schoolId: school,
            name: values.teamName,
            startTime: values.workStartTime,
            endTime: values.workEndTime,
            type: values.teamType,
            userIdAll: values.peopleToJoinTeam,
            categoryId: values.categoryId,
        })
    );
}

export let getTeammateBySchoolAndTypeApi = (school, type) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getNewClassUnusedMember", {
            schoolId: school,
            classtype: type
        })
    );
}

export let updateTeamApi = (school, teamId, values) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/updateClass", {
            schoolId: school,
            id: teamId,
            name: values.teamName,
            startTime: values.workStartTime,
            endTime: values.workEndTime,
            chargeManId: values.chargeManId,
            type: values.teamType,
            categoryId: values.categoryId
        })
    );
}

export let getTeammateByTeamIdApi = (teamId) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getAllClassMember", {
            classId: teamId
        })
    );
}

export let getAllClassByMemberNameApi = (school, name) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getAllClassByMemberName", {
            schoolId: school,
            realName: name
        })
    );
}

export let deleteTeammateApi = (teamId, userId) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/deleteClassmates", {
            classId: teamId,
            userId: userId
        })
    );
}

export let setChargeManApi = (teamId, userId) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/setChargeMan", {
            id: teamId,
            userId: userId
        })
    );
}


export let getallAvailablePeopleByTeamIdApi = (teamId, teamType) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getThisClassUnusedMember", {
            classId: teamId,
            type: teamType
        })
    );
}

export let addTeammateApi = (teamId, values) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/addClassMember", {
            classId: teamId,
            userId: values.peopleToJoinTeam
        })
    );
}

export let patrolRouteBySchoolApi = (school, routeNameId) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getPatrolRouteByRouteNameId", {
            schoolId: school,
            routeNameId: routeNameId
        })
    );
}


// export let updatePatrolRouteApi = (data) => {
//     return (
//         Axios.post(backstageUrl + "schoolSafetySupervisor/updatePatrolRoute", {
//             data: data,
//         })
//     );
// }



export let checkpointBySchoolAndTypeApi = (school, type) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getCheckpointBySchoolAndType", {
            schoolId: school,
            type: type
        })
    );
}

export let checkpointBySchoolAndTypeExceptExistApi = (school) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getCheckpointBySchoolAndTypeExceptExist", {
            schoolId: school,
        })
    );
}

export let safetysceneBySchoolApi = (school) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getSafetySceneBySchool", {
            schoolId: school,
        })
    );
}

export let updateSafetysceneApi = (id, values) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/updateSafetyScene", {
            id: id,
            categoryId: values.categoryId
        })
    );
}

export let safetysceneDetailByIdApi = (id) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getSafetySceneDetailById", {
            id: id,
        })
    );
}

export let inspectPlanClassBySchoolIdApi = (schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getInspectPlanClassBySchoolId", {
            schoolId: schoolId,
        })
    );
}



export let inspectPlanByClassIdApi = (school, classId, isMore) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getInspectPlanByClassId", {
            classId: classId,
            schoolId: parseInt(school),
            isMore: isMore,
        })
    );
}

export let inspectDealDetailByInspectPlanIdApi = (id) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getInspectConditionInfoByPlanId", {
            inspectPlanId: id,
        })
    );
}

export let getInspectPlanHistoryApi = (schoolId, startDate, endDate) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/InspectHistory", {
            schoolId: schoolId,
            startDate: startDate,
            endDate: endDate
        })
    );
}

export let addInspectPlanFromHistoryApi = (schoolId, startDate, endDate, values) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/addInspectHistory", {
            schoolId: schoolId,
            startDate: startDate,
            endDate: endDate,
            values: values
        })
    );
}

export let forwardSafetyScene = (id, reporter, categoryId, category) => {
    return (
        Axios.post(baseUrl + "weChatSystem/forwardSafetyScene", {
            id: id,
            content: "转发到" + category,
            reporter: reporter,
            categoryId: categoryId
        })
    );
}

export let getAccessTokenForSendMsg = () => {
    return (
        Axios.get(baseUrl + "weChatSystem/getAccessTokenForSendMsg")
    );
}

export let getChargeManWeChatId = (categoryId, schoolId) => {
    return (
        Axios.post(baseUrl + "weChatSystem/getChargeManWeChatId", {
            categoryId: categoryId,
            schoolId: schoolId
        })
    );
}

export let sendMessage = (accessToken, toUser, category, content, reporter, dateTime) => {
    return (
        Axios.post(baseUrl + "weChatSystem/sendMessage", {
            accessToken: accessToken,
            touser: toUser,
            miniprogram: {
                appid: "wx703e003472dcb656",
                path: "pages/index/index",
            },
            data: {
                first: {
                    value: "隐患现场"
                },
                keyword1: {
                    value: category
                },
                keyword2: {
                    value: content
                },
                keyword3: {
                    value: reporter
                },
                keyword4: {
                    value: dateTime
                },
                remark: {
                    value: "请尽快处理。"
                }
            }
        })
    );
}


export let allMessagepushBySchoolApi = (school) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getMessagePushBySchool", {
            schoolId: school,
        })
    );
}

export let addMessagepushApi = (school, values) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/addMessagePush", {
            schoolId: school,
            pushTime: values.pushTime,
            userId: values.pushPeople
        })
    );
}

export let getAllPeopleBySchoolForMessagepush = (school) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getAllPeopleBySchoolForMessagePush", {
            schoolId: school,
        })
    );
}

export let deleteMessagepushApi = (id) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteMessagePush", {
            id: id
        })
    );
}

export let allInspectpushBySchoolApi = (school) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getMessagePushBySchool2", {
            schoolId: school,
        })
    );
}

//新增事件推送功能
export let allEventpushBySchoolApi = (school) => {
    return (
        Axios.get(backstageUrl + "schoolMangement/getEventPushBySchool", {
            params: {
                schoolId: school,
            }
        })
    );
}

export let deleteEventpushApi = (id) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteMessagePush4", {
            id: id,
        })
    );
}
export let changeEventpushStateApi = (pushState, id) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/changeMessagePushState4", {
            id: id,
            pushState: pushState
        })
    );
}

export let addEventpushApi = (school, values) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/addMessagePush4", {
            schoolId: school,
            pushTime: '00:00:00',
            userId: values.pushPeople,
            type:values.type
        })
    );
}

//新增考勤推送功能
export let allKaoQinPushBySchoolApi = (school) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getMessagePushBySchool4", {
            schoolId: school,
            type: 4
        })
    );
}

export let deleteKaoQinPushApi = (id) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteMessagePush4", {
            id: id
        })
    );
}

export let addKaoQinPushApi = (school, values) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/addMessagePush4", {
            schoolId: school,
            pushTime: values.pushTime,
            userId: values.pushPeople,
            type: 4
        })
    );
}

//新增值周推送功能
export let allZhiZhouPushBySchoolApi = (school) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getMessagePushBySchool4", {
            schoolId: school,
            type: 5
        })
    );
}

export let deleteZhiZhouPushApi = (id) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteMessagePush4", {
            id: id
        })
    );
}

export let addZhiZhouPushApi = (school, values) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/addMessagePush4", {
            schoolId: school,
            pushTime: values.pushTime,
            userId: values.pushPeople,
            type: 5
        })
    );
}
export let updateZhizhouPushTimeApi = (id, values)=>{
    return(
        Axios.post(backstageUrl+"schoolMangement/updateZhizhouPushTime", {
            id:id,
            pushTime:values.pushTime
        })
    );
}
export let updateInspectPushTimeApi = (id, values)=>{
    return(
        Axios.post(backstageUrl+"schoolMangement/updateInspectPushTime", {
            id:id,
            pushTime:values.pushTime
        })
    );
}
export let updatePatrolPushTimeApi = (id, values)=>{
    return(
        Axios.post(backstageUrl+"schoolMangement/updatePatrolPushTime", {
            id:id,
            pushTime:values.pushTime
        })
    );
}
//-----------------------------------------------------

export let addInspectpushApi = (school, values) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/addMessagePush2", {
            schoolId: school,
            pushTime: values.pushTime,
            userId: values.pushPeople
        })
    );
}

export let deleteInspectpushApi = (id) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteMessagePush2", {
            id: id
        })
    );
}


export let getBlueteethApi = (school) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getBlueTeethBySchool", {
            schoolId: school
        })
    );
}

export let updateDistanceApi = (school, values) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/updateDistance", {
            distance: parseInt(values.distance),
            schoolId: parseInt(school),
        })
    );
}

export let listSafetyScenePushApi = (school) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/listSafetyScenePush", {
            schoolId: school,
        })
    );
}

export let saveSafetyScenePushApi = (schoolId, categoryId, userId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/saveSafetyScenePush", {
            schoolId: schoolId,
            categoryId: categoryId,
            userId: userId
        })
    );
}

export let updateUUIDApi = (school, uuid) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/updateUuid", {
            uuid: uuid,
            schoolId: parseInt(school),
        })
    );
}

export let updateMajorApi = (school, major) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/updateMajor", {
            major: major,
            schoolId: parseInt(school),
        })
    );
}

export let listEmergencyContactApi = (school) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/listEmergencyContact", {
            schoolId: parseInt(school),
        })
    );
}

export let deleteEmergencyContactApi = (school, userId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteEmergencyContact", {
            schoolId: parseInt(school),
            userId: userId
        })
    );
}

export let listEmergencyContactOptionApi = (school) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/listEmergencyContactOption", {
            schoolId: parseInt(school),
        })
    );
}

export let insertEmergencyContactApi = (school, userId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/insertEmergencyContact", {
            schoolId: parseInt(school),
            userId: userId
        })
    );
}

export let addMenuApi = (values, parent, identityId, order) => {
    return (
        Axios.post(userUrl + "permission/addMenu", {
            name: values.name,
            route: values.route,
            key: values.key,
            icon: values.icon,
            parent: parent,
            identityId: identityId,
            order: order,
        })
    );
}

export let listMenuApi = (identityId) => {
    return (
        Axios.post(userUrl + "permission/listMenu", {
            identityId: identityId
        })
    );
}

export let deleteMenuApi = (menuId) => {
    return (
        Axios.post(userUrl + "permission/deleteMenu", {
            id: menuId
        })
    );
}

export let updateMenuApi = (values, menuId) => {
    return (
        Axios.post(userUrl + "permission/updateMenu", {
            id: menuId,
            name: values.name,
            route: values.route,
            key: values.key,
            icon: values.icon
        })
    );
}

export let listPermissionByDepartment = (departmentId) => {
    return (
        Axios.post(userUrl + "permission/listPermissionByDepartment", {
            departmentId: departmentId
        })
    );
}

export let listDefaultPermissionByIdentityApi = (identityId) => {
    return (
        Axios.post(userUrl + "permission/listRootMenu", {
            identityId: identityId
        })
    );
}

export let updatePermissionsApi = (departmentId, identityId, permissions) => {
    return (
        Axios.post(userUrl + "permission/updatePermissions", {
            departmentId: departmentId,
            identityId: identityId,
            permissionsId: permissions
        })
    );
}

export let listMenuByPermission = (departmentId, identityId) => {
    return (
        Axios.post(userUrl + "permission/listMenuByPermission", {
            department: departmentId,
            identityString: identityId
        })
    );
}

export let getCategoryItemNumApi = (schoolId, isDefined) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getCategoryItemNum", {
            schoolId: schoolId,
            isDefined: isDefined
        })
    );
}

export let getManualBySchoolAndCategoryApi = (school, categoryId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getInspectitemSelfDefinedSimpleBySchool", {
            schoolId: school,
            categoryId: categoryId
        })
    );
}


export let getManualDetailBySchoolAndItemApi = (school, item, categoryId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getInspectitemSelfDefinedByItem", {
            schoolId: school,
            item: item,
            categoryId: categoryId
        })
    );
}




export let deleteManualByItemApi = (school, item, isDefined) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteInspectitemSelfDefinedByItem", {
            schoolId: school,
            item: item,
            isDefined: isDefined
        })
    );
}

export let deleteManualByContentApi = (manualId, content) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteInspectitemSelfDefinedByIdOrContent", {
            id: manualId,
            content: content,
        })
    );
}

export let getManualForUpdateApi = (school, isDefined, categoryId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getInspectitemSelfDefinedFromInspectitemBySchoolAndCategoryId", {
            schoolId: school,
            isDefined: isDefined,
            categoryId: categoryId
        })
    );
}

export let updateManualApi = (school, values, categoryId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/addInspectitemSelfDefinedFromInspectitemBySchool", {
            schoolId: school,
            values: values,
            categoryId: categoryId
        })
    );
}

export let getPatrolCountByDay = (schoolId) => {
    return (
        Axios.get(backstageUrl + "Statistics/getPatrolCountByDay", {
            params: {
                schoolId: schoolId,
            }
        })
    );
};


export let getInspectTimeByDay = (schoolId) => {
    return (
        Axios.get(backstageUrl + "Statistics/getInspectTimeByDay", {
            params: {
                schoolId: schoolId,
            }
        })
    );
};

export let getTroublePoint = (schoolId) => {
    return (
        Axios.get(backstageUrl + "Statistics/getTroublePoint", {
            params: {
                schoolId: schoolId,
            }
        })
    );
};

export let getTroubleItem = (schoolId) => {
    return (
        Axios.get(backstageUrl + "Statistics/getTroubleItem", {
            params: {
                schoolId: schoolId,
            }
        })
    );
};

export let getPatrolCountAll = (schoolId) => {
    return (
        Axios.get(backstageUrl + "Statistics/getPatrolCountAll", {
            params: {
                schoolId: schoolId,
            }
        })
    );
};

//获取指定学校的所有蓝牙以及NFC设备信息
export let allBlueteethDeviceApi = (schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getAllBlueTeethDevice", {
            schoolId: schoolId,
        })
    );
}

//获取所有学校的所有蓝牙以及NFC设备信息
export let getAllBlueTeethDeviceApi = () => {
    return (
        Axios.get(backstageUrl + "schoolMangement/AllBlueTeethDevice", {
        })
    );
}

//根据条件获取对应的蓝牙以及NFC设备信息
export let getAllBlueTeethDeviceByConditionApi = (values) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getAllBlueTeethDeviceByCondition", {
            type: values.type,
            departmentName: values.departmentName,
            macAddressId: values.macAddressId
        })
    );
}

export let addBlueTeethDeviceApi = (schoolId, values) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/addBlueTeethDevice", {
            schoolId: schoolId,
            macAddress: values.macAddress,
            // settleAddress: values.settleAddress,
        })
    );
}
//批量导入设备网点地址关联关系
export let batchIncreaseRelationApi = (formData) => {
    return (
        Axios({
            method: 'post',
            url: backstageUrl + 'schoolMangement/batchIncreaseRelation',
            headers: { "Content-Type": "multipart/form-data" },
            processData: false,
            data: formData
        })
    );
}

export let deleteBlueTeethDeviceApi = (id, schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteBlueTeethDevice", {
            schoolId: schoolId,
            id: id,
        })
    );
}

export let allAddressApi = (schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getAllAddress", {
            schoolId: schoolId,
        })
    );
}

export let addAddressApi = (schoolId, values) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/addAddress", {
            schoolId: schoolId,
            type: values.type,
            address: values.address,
        })
    );
}

export let updateAddressApi = (id, schoolId, values) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/updateAddress", {
            id: id,
            schoolId: schoolId,
            address: values.address,
            type: values.type
        })
    );
}

export let deleteAddressApi = (id, schoolId, type) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteAddress", {
            id: id,
            schoolId: schoolId,
            type: type,
        })
    );
}

export let allAddressInBlueteethRelationApi = (schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getAllAddressAndBlueTeethRelation", {
            schoolId: schoolId,
        })
    );
}

export let getAddressWithBlueteethByAddressApi = (schoolId, address, type) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getAllAddressAndBlueTeethRelationByAddress", {
            schoolId: schoolId,
            address: address,
            type: type
        })
    );
}

export let deleteAddressWithBlueteethSingleApi = (address, macAddress, schoolId, type) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteAddressAndBlueTeethRelationSingle", {
            address: address,
            macAddress: macAddress,
            schoolId: schoolId,
            type: type

        })
    );
}

export let deleteAddressWithBlueteethMulApi = (address, schoolId, type) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteAddressWithBlueTeethMul", {
            address: address,
            schoolId: schoolId,
            type: type
        })
    );
}

export let addAddressWithBlueteethMulApi = (address, macAddress, type, schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/addAddressAndBlueTeethRelationMul", {
            address: address,
            schoolId: schoolId,
            macAddress: macAddress,
            type: type,
        })
    );
}

export let addAndUpdateAddressWithBlueteethSingleApi = (address, macAddress, type, schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/addAndUpdateAddressWithBlueTeethSingle", {
            address: address,
            schoolId: schoolId,
            macAddress: macAddress,
            type: type, //巡检地点只能添加关联,//巡更地点只能更新关联
        })
    );
}

export let getUsableAddressAndMacAddressApi = (type, schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getUsableAddressAndMacAddress", {
            schoolId: schoolId,
            type: type,
        })
    );
}

export let getBlueteethForRelationApi = (address, type, schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getBlueTeethForRelation", {
            schoolId: schoolId,
            address: address,
            type: type
        })
    );
}

export let getTodayInfo = (schoolId) => {
    return (
        Axios.get(backstageUrl + "Statistics/getTodayInfo", {
            params: {
                schoolId: schoolId,
            }
        })
    );
}

export let getAllTimeInfo = (schoolId) => {
    return (
        Axios.get(backstageUrl + "Statistics/getAllTimeInfo", {
            params: {
                schoolId: schoolId,
            }
        })
    );
}

export let getInspectPlanSearchApi = (schoolId, values) => {
    if (values.deadline == undefined) {
        return (
            Axios.post(backstageUrl + "schoolSafetySupervisor/InspectPlanSearch", {
                schoolId: schoolId,
                className: values.teamName,
                startDate: undefined,
                endDate: undefined,
                address: values.address,
                categoryId: values.categoryId, //array
                status: values.doneStatus, //全部完成、部分完成、未完成
                normal: values.doneResult, //一切正常、异常已处理、有异常
            })
        );
    } else {
        return (
            Axios.post(backstageUrl + "schoolSafetySupervisor/InspectPlanSearch", {
                schoolId: schoolId,
                className: values.teamName,
                startDate:moment(values.deadline[0]).format('YYYY-MM-DD'),
                endDate:moment(values.deadline[1]).format('YYYY-MM-DD'),
                address: values.address,
                categoryId: values.categoryId, //array
                status: values.doneStatus, //全部完成、部分完成、未完成
                normal: values.doneResult, //一切正常、异常已处理、有异常
            })
        );
    }
}
//NFC记录查询
export let getNFCInspectSearchApi = (schoolId, values) => {
    if (values == undefined) {
        return (
            Axios.post(backstageUrl + "schoolSafetySupervisor/NFCInspectRecord", {
                schoolId: schoolId,
            })
        );
    } else if (values.deadline == undefined) {
        return (
            Axios.post(backstageUrl + "schoolSafetySupervisor/NFCInspectRecord", {
                schoolId: schoolId,
                realname: values.realname,
                startDate: undefined,
                endDate: undefined,
                address: values.address,
                deviceName: values.deviceName,
                status: values.status, //一切正常、异常已处理、有异常
            })
        );
    } else {
        return (
            Axios.post(backstageUrl + "schoolSafetySupervisor/NFCInspectRecord", {
                schoolId: schoolId,
                realname: values.realname,
                startDate: values.deadline[0],
                endDate: values.deadline[1],
                address: values.address,
                deviceName: values.deviceName,
                status: values.status, //一切正常、异常已处理、有异常
            })
        );
    }
}
//NFC记录查询详情
export let getNFCInspectRecordDetailApi = (schoolId, item, createTime) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/NFCInspectRecordDetail", {
            schoolId: schoolId,
            item: item,
            createTime: createTime
        })
    );
}

export let getExistCategoryBySchoolIdAip = (schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getExistCategoryBySchoolId", {
            schoolId: schoolId,
        })
    );
}

export let getInspectSearchChartDataApi = (schoolId, values) => {
    console.log(values.deadline)
    if (values.deadline == undefined) {
        return (
            Axios.post(backstageUrl + "schoolSafetySupervisor/getInspectSearchChartData", {
                schoolId: schoolId,
                className: values.teamName,
                startDate: undefined,
                endDate: undefined,
                address: values.address,
                categoryId: values.categoryId, //array
                // status: values.doneStatus, //全部完成、部分完成、未完成
                // normal: values.doneResult, //一切正常、异常已处理、有异常
            })
        );
    } else {
        return (
            Axios.post(backstageUrl + "schoolSafetySupervisor/getInspectSearchChartData", {
                schoolId: schoolId,
                className: values.teamName,
                startDate: moment(values.deadline[0]).format('YYYY-MM-DD'),
                endDate: moment(values.deadline[1]).format('YYYY-MM-DD'),
                address: values.address,
                categoryId: values.categoryId, //array
                // status: values.doneStatus, //全部完成、部分完成、未完成
                // normal: values.doneResult, //一切正常、异常已处理、有异常
            })
        );
    }
}

export let getSafetySceneSearchApi = (schoolId, values) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/SafetySceneSearch", {
            schoolId: schoolId,
            address: values.address,
            categoryId: values.categoryId, //array
            safetyLevel: values.safetyLevel,
            name: values.reporterName,
            status: values.status,
            reportStartDate: values.reportStartDate,
            reportEndDate: values.reportEndDate,
            dealStartDate: values.dealStartDate,
            dealEndDate: values.dealEndDate,
            dealName: values.dealName,
        })
    );
}

export let getSafetySceneSearchChartDataApi = (schoolId, values) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/SafetySceneSearchChartData", {
            schoolId: schoolId,
            address: values.address,
            categoryId: values.categoryId, //array
            safetyLevel: values.safetyLevel,
            name: values.reporterName,
            status: values.status,
            reportStartDate: values.reportStartDate,
            reportEndDate: values.reportEndDate,
            dealStartDate: values.dealStartDate,
            dealEndDate: values.dealEndDate,
            dealName: values.dealName,
        })
    );
}

export let getDeviceInfoListApi = (departmentId) => {
    return (
        Axios.post(backstageUrl + "GpsFireController/getDeviceInfoList", {
            departmentId: departmentId
        })
    );
}

export let getChartTemperatureApi = (imei, startTime, endTime) => {
    return (
        Axios.post(backstageUrl + "GpsFireController/getHistoryTemperatureNew", {
            IMEI: imei,
            startTime: startTime,
            endTime: endTime,
        })
    );
}

export let getChartElectricApi = (imei, startTime, endTime) => {
    return (
        Axios.post(backstageUrl + "GpsFireController/getHistoryElectricNew", {
            IMEI: imei,
            startTime: startTime,
            endTime: endTime,
        })
    );
}

export let getHistoryEleOrTemApi = (imei, type, threshold) => {
    return (
        Axios.post(backstageUrl + "GpsFireController/getAllErrorMessage", {
            IMEI: imei,
            type: type,
            threshold: threshold,
        })
    );
}


// export let addInspectItemBySchoolIdApi = (formData) => {
//     return (
//         Axios({
//             method: 'post',
//             url: baseUrl + 'permission/addInspectItemBySchoolId',
//             headers: { "Content-Type": "multipart/form-data" },
//             processData: false,
//             data: formData
//         })
//     );
// }

export let addInspectItemBySchoolIdApi = (formData) => {
    return (
        Axios({
            method: 'post',
            url: userUrl + 'permission/addInspectItemBySchoolId',
            headers: { "Content-Type": "multipart/form-data" },
            processData: false,
            data: formData
        })
    );
}

export let getAllInspectItemCategoryApi = () => {
    return (
        Axios.get(userUrl + "permission/getAllInspectItemCategory", {

        })
    );
}

export let getInspectItemsByCategoryIdApi = (categoryId) => {
    return (
        Axios.post(userUrl + "permission/getInspectItemsByCategoryId", {
            categoryId: categoryId,
        })
    );
}

export let getInspectItemsByPushCategoryIdApi = (pushCategoryId) => {
    return (
        Axios.post(userUrl + "permission/getInspectItemsByPushCategoryId", {
            pushCategoryId: pushCategoryId,
        })
    );
}

export let getInspectItemsByItemApi = (item) => {
    return (
        Axios.post(userUrl + "permission/getInspectItemsByItem", {
            item: item,
        })
    );
}

export let getInspectItemsByContentApi = (content) => {
    return (
        Axios.post(userUrl + "permission/getInspectItemsByContent", {
            content: content,
        })
    );
}

export let getRecentDeviceInfoApi = (departmentId) => {
    return (
        Axios.post(backstageUrl + "GpsFireController/getRecentDeviceInfoNew", {
            departmentId: departmentId,
        })
    );
}

export let getInspectTypeApi = (eduDepartmentId) => {
    return (
        Axios.post(backstageUrl + "eduDepartmentManagement/getInspectType", {
            eduDepartmentId: eduDepartmentId,
        })
    );
}

export let updateInspectTypeApi = (type, eduDepartmentId, childDepartmentId) => {
    return (
        Axios.post(backstageUrl + "eduDepartmentManagement/updateInspectType", {
            type: type,
            eduDepartmentId: eduDepartmentId,
            childDepartmentId: childDepartmentId,
        })
    );
}

export let importChildSchoolApi = (eduDepartmentId) => {
    return (
        Axios.post(backstageUrl + "eduDepartmentManagement/importChildSchool", {
            eduDepartmentId: eduDepartmentId,
        })
    );
}

export let SchoolAllApi = () => {
    return (
        Axios.get(backstageUrl + "AttendanceSys/getAllSchool")
    );
}


export let importPublicMemberListApi = (formData) => {
    return (
        Axios({
            method: 'post',
            url: baseUrl + 'AttendanceSys/importPublicMemberList',
            headers: { "Content-Type": "multipart/form-data" },
            processData: false,
            data: formData
        })
    );
}

// ----------------------------------

export let getAllFeaturesApi = () => {
    return (
        Axios.get(userUrl + "permission/getAllFeatures", {})
    );
}

export let addMainFeaturesApi = (values, order) => {
    return (
        Axios.post(userUrl + "permission/addMainFeatures", {
            name: values.name,
            description: values.description,
            route: values.route,
            icon: values.icon,
            order: order,
            key: values.key,
        })
    );
}

export let addChildFeaturesApi = (values, parent, order) => {
    return (
        Axios.post(userUrl + "permission/addChildFeatures", {
            name: values.name,
            description: values.description,
            route: values.route,
            icon: values.icon,
            order: order,
            key: values.key,
            parentfeaturesId: parent
        })
    );
}

export let updateChildFeaturesApi = (values, id) => {
    return (
        Axios.post(userUrl + "permission/updateChildFeatures", {
            name: values.name,
            description: values.description,
            route: values.route,
            icon: values.icon,
            key: values.key,
            id: id
        })
    );
}

export let deleteChildFeaturesApi = (id) => {
    return (
        Axios.post(userUrl + "permission/deleteChildFeatures", {
            id: id
        })
    );
}

export let getDepartmentRoleAndFeaturesApi = (department) => {
    return (
        Axios.post(userUrl + "permission/getDepartmentRoleAndFeatures", {
            department: department
        })
    );
}

export let getRoleCanAddFeaturesApi = (roleId) => {
    return (
        Axios.post(userUrl + "permission/getRoleCanAddFeatures", {
            roleId: roleId
        })
    );
}

export let updateRoleFeaturesApi = (roleId, childFeaturesId) => {
    return (
        Axios.post(userUrl + "permission/updateRoleFeatures", {
            roleId: roleId,
            childFeaturesId: childFeaturesId
        })
    );
}

export let deleteRoleApi = (roleId) => {
    return (
        Axios.post(userUrl + "permission/deleteRole", {
            roleId: roleId,
        })
    );
}

export let addRoleApi = (departmentId, role, description) => {
    return (
        Axios.post(userUrl + "permission/addRole", {
            department: departmentId,
            name: role,
            description: description,
        })
    );
}

export let getUserPermissionApi = (id) => {
    return (
        Axios.post(userUrl + "AccountManagement/getUserPermission", {
            id: id,
        })
    );
}

export let deleteGpsFireElectricApi = (id) => {
    return (
        Axios.post(backstageUrl + "GpsFireController/deleteGpsFireElectric", {
            id: id,
        })
    );
}

export let getUnDeployDiviceApi = () => {
    return (
        Axios.post(backstageUrl + "GpsFireController/getAllEquipmentDeviceId", {})
    );
}

export let addGpsFireElectricDeviceApi = (departmentId, values) => {
    return (
        Axios.post(backstageUrl + "GpsFireController/addGpsFireElectricDevice", {
            departmentId: departmentId,
            ieme: values.IMEI,
            name: values.address,
            temperature: values.temperaturethreshold,
            threshold: values.electricalthreshold,
        })
    );
}

export let updateGpsFireElectricDeviceApi = (departmentId, values) => {
    return (
        Axios.post(backstageUrl + "GpsFireController/updateGpsFireElectricDevice", {
            departmentId: departmentId,
            ieme: values.IMEI,
            name: values.address,
            temperature: values.temperaturethreshold,
            threshold: values.electricalthreshold,
        })
    );
}

export let getAllCallBackDeviceApi = () => {
    return (
        Axios.post(baseUrl + "DeviceCallBackController/getAllCallBackDevice", {})
    );
}

// 根据条件筛选相应的设备
export let getAllCallBackDeviceByConditionApi = (values) => {
    return (
        Axios.post(baseUrl + "DeviceCallBackController/getAllCallBackDeviceByCondition", {
            deviceType: values.deviceType,
            departmentName: values.departmentName,
            deviceId: values.deviceId,
            deviceName: values.deviceName,
            deviceAddress: values.deviceAddress,
            work: values.work
        })
    );
}

export let addDeviceApi = (formData) => {
    return (
        Axios({
            method: 'post',
            url: baseUrl + 'DeviceCallBackController/addDevice',
            headers: { "Content-Type": "multipart/form-data" },
            processData: false,
            data: formData
        })
    );
}

export let deleteDeviceApi = (id, deviceId) => {
    return (
        Axios.post(baseUrl + "DeviceCallBackController/deleteDevice", {
            id: id,
            deviceId: deviceId
        })
    );
}

export let updateDeviceApi = (id, values) => {
    return (
        Axios.post(baseUrl + "DeviceCallBackController/updateDevice", {
            id: id,
            deviceId: values.deviceId,
            deviceType: values.devicetype,
            deviceName: values.deviceName,
            deviceAddress: values.deviceAddress,
            department: values.department,
        })
    );
}

export let getAllSmokeDeviceRecordBySchoolIdApi = (department) => {
    return (
        Axios.post(baseUrl + "DeviceCallBackController/getAllSmokeDeviceRecordBySchoolId", {
            department: department,
        })
    );
}

export let getSearchSmokeDeviceRecordApi = (department, values) => {
    return (
        Axios.post(baseUrl + "DeviceCallBackController/getSearchSmokeDeviceRecordTimes", {
            department: department,
            address: values.address,
            deviceId: values.deviceId,
            deviceStatus: values.deviceStatus,
            fireAlarm: values.fireAlarm,
            name: values.name,
            smokeConcLittle: values.smokeConc.numberLittle == '' ? undefined : values.smokeConc.numberLittle,
            smokeConcLarge: values.smokeConc.numberLarge == '' ? undefined : values.smokeConc.numberLarge,
            tamper: values.tamper,
            timePre: values.timePre,
            timeAfter: values.timeAfter
        })
    );
}

export let getSingleSmokeDeviceRecordApi = (department, deviceId) => {
    return (
        Axios.post(baseUrl + "DeviceCallBackController/getSearchSmokeDeviceRecordByDeviceId", {
            department: department,
            deviceId: deviceId
        })
    );
}

export let getUpAndDownDeviceMessageApi = (department) => {
    return (
        Axios.post(baseUrl + "DeviceCallBackController/getUpAndDownDeviceMessage", {
            department: department,
        })
    );
}

export let getFaceRecordByDepartmentApi = (department) => {
    return (
        Axios.post(baseUrl + "DeviceCallBackController/getFaceRecordByDepartment", {
            department: department,
        })
    );
}

export let getFaceImageBasicManageApi = (department) => {
    return (
        Axios.post(baseUrl + "DeviceCallBackController/getFaceImageBasicManage", {
            department: department,
        })
    );
}


export let getScheduleTagApi = (department) => {
    return (
        Axios.post(baseUrl + "schoolMangement/getScheduleTag", {
            department: department,
        })
    );
}

export let getDeviceEnterConditionByUserNumberApi = (department, usernumber) => {
    return (
        Axios.post(baseUrl + "DeviceCallBackController/getDeviceEnterConditionByUserNumber", {
            usernumber: usernumber,
            department: department,
        })
    );
}
export let getScheduleDataApi = (department, year, month) => {
    return (
        Axios.post(baseUrl + "schoolMangement/getScheduleData", {
            department: department,
            year: year,
            month: month
        })
    );
}

export let deleteFaceImageApi = (department, usernumber) => {
    return (
        Axios.post(baseUrl + "DeviceCallBackController/deleteFaceImage", {
            usernumber: usernumber,
            department: department,
        })
    );
}
export let addScheduleTagApi = (department, name) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/addScheduleTag", {
            department: department,
            name: name
        })
    );
}

export let deleteUpdateRecordApi = (id) => {
    return (
        Axios.post(baseUrl + "DeviceCallBackController/deleteUpdateRecord", {
            id: id
        })
    );
}
export let deleteScheduleTagApi = (department, id) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteScheduleTag", {
            department: department,
            id: id
        })
    );
}

export let updateScheduleTagApi = (department, id, date) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/updateScheduleTag", {
            department: department,
            id: id,
            date: date
        })
    );
}

export let getAttendanceRecordApi = (department, values) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getFaceRecord", {
            department: department,
            name: values.name,
            userNumber: values.userNumber,
            employer: values.employer,
            enter: values.enter,
            timePre: values.timePre,
            timeAfter: values.timeAfter,
            deviceName: values.deviceName,
            ip: values.ip,
            userType: values.userType
        })
    );
}

export let getAttendanceSearchOptionDataApi = (department) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getFaceSearchOptionData", {
            department: department,
        })
    );
}

export let getHistoryTemperatureApi = (values) => {
    return (
        Axios.post(backstageUrl + "GpsFireController/getHistoryTemperatureNew", {
            IMEI: values.imei,
            startTime: values.startTime,
            endTime: values.endTime,
        })
    );
}

export let getHistoryElectricApi = (values) => {
    return (
        Axios.post(backstageUrl + "GpsFireController/getHistoryElectricNew", {
            IMEI: values.imei,
            startTime: values.startTime,
            endTime: values.endTime,
        })
    );
}
export let getSchoolIdScreenUrlApi = (departmentId, identityId) => {
    return (
        Axios.post(userUrl + "AccountManagement/getSchoolIdScreenUrl", {
            departmentId: departmentId,
            identityId: identityId,
        })
    );
}




export let getattendanceSettimeListApi = (departmentId) => {
    return (
        Axios.post(baseUrl + "AttendanceSys/getattendanceSettimeList", {
            department: departmentId,

        })
    );
}


export let AttenceDepartentApi = (departmentId) => {
    return (
        Axios.post(baseUrl + "AttendanceSys/getAttenceDepartent", {
            department: departmentId
        })
    );
}




export let deleteaddAttendanceTimeApi = (department, employ) => {
    return (
        Axios.post(baseUrl + "AttendanceSys/deleteAttendanceTime", {
            department: department,
            employ: employ
        })
    );
}
export let addAttendanceTimeApi = (departmentId, employid, values) => {
    return (
        Axios.post(baseUrl + 'AttendanceSys/addAttendanceTime', {

            department: departmentId,
            employId: employid,
            startTime: values.startTime,
            endTime: values.endTime,
            employ: values.employ,
            isset: 1,


        })
    );
}


export let updateAttendanceTimeApi = (departmentId, employid, values) => {
    return (
        Axios.post(baseUrl + "AttendanceSys/updateAttendanceTime", {

            department: departmentId,
            employId: employid,
            startTime: values.startTime,
            endTime: values.endTime,
            employ: values.employ,
            isset: 1,
        })
    );
}


export let getHistoryCheckApi = (departmentId, values) => {
    return (
        Axios.post(baseUrl + "AttendanceSys/getHistoryCheck", {

            department: departmentId,
            startDate: values.startDate,
            endDate: values.endDate,
            employer: values.employer,
        })
    );
}




export let getDutyCategoryItemNumApi = (schoolId) => {
    return (
        Axios.get(zhizhouUrl + "WeChat/weChatSystem/getDutyCategoryItemNum", {


            params: {
                schoolId: schoolId,
            }

        })
    );
}
export let getDutyCategoryandUserDefinedTabledataApi = (school, categoryId) => {
    return (
        Axios.post(zhizhouUrl + "WeChat/weChatSystem/getDutyuserdefinedContent", {
            schoolId: school,
            categoryId: categoryId
        })
    );
}


export let getCheckpointAndCategoryApi = (schoolId, categoryId) => {
    return (
        Axios.post(zhizhouUrl + "WeChat/weChatSystem/getCheckpointAndCategory", {

            schoolId: schoolId,
            categoryId: categoryId
        }))

}


export let getVisitorMessageApi = (schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getVisitorMessage", {
            schoolId: schoolId,
        })
    );
}
export let getVisitorrecordSearchApi = (schoolId, values) => {
    console.log(values.deadline)
    if (values.deadline == undefined) {
        return (
            Axios.post(backstageUrl + "schoolSafetySupervisor/VisitorrecordSearch", {
                schoolId: schoolId,
                deviceId: values.deviceId,
                datetime: undefined,
                leavetime: undefined,
                visitorname: values.visitorname,
            })
        );
    } else {
        return (
            Axios.post(backstageUrl + "schoolSafetySupervisor/VisitorrecordSearch", {
                schoolId: schoolId,
                deviceId: values.deviceId,
                datetime: values.deadline[0],
                leavetime: values.deadline[1],
                visitorname: values.visitorname,
            })
        );
    }
}

export let getVisitorTimeByDay = (schoolId) => {
    return (
        Axios.get(backstageUrl + "Statistics/getVisitorTimeByDay", {
            params: {
                schoolId: schoolId,
            }
        })
    );
};

export let getTodayVisitorInfo = (schoolId) => {
    return (
        Axios.get(backstageUrl + "Statistics/getTodayVisitorInfo", {
            params: {
                schoolId: schoolId,
            }
        })
    );
}


export let getDutyallitemApi = (schoolId, categoryId) => {
    return (
        Axios.post(zhizhouUrl + "WeChat/weChatSystem/getDutyallitem", {

            schoolId: schoolId,
            categoryId: categoryId
        })
    );
}


export let getCheckpointFromCategoryApi = (school, categoryId) => {
    return (
        Axios.post(baseUrl + "weChatSystem/getCheckpointFromCategory", {
            schoolId: school,
            categoryId: categoryId
        })
    );
}




export let addDutyUserDefinedContentApi = (school, categoryId, items) => {
    return (
        Axios.post(zhizhouUrl + "WeChat/weChatSystem/addDutyUserDefinedItem", {
            schoolId: school,
            categoryId: categoryId,
            itemIds: items
        })
    );
}


export let addCheckpointAndCategoryApi = (school, categoryId, checkpointIds) => {
    return (
        Axios.post(zhizhouUrl + "WeChat/weChatSystem/addCheckpointAndCategory", {
            schoolId: school,
            categoryId: categoryId,
            checkpointIds: checkpointIds
        })
    )
}



export let deleteContentTableDtatalByItemApi = (schoolId, categoryId, item) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/DeleteDutyWeekUserItemDefined", {
            schoolId: schoolId,
            categoryId: categoryId,
            item: item,

        })
    );
}

export let deleteCheckpointFromCategoryApi = (schoolId, categoryId, item) => {
    return (
        Axios.post(zhizhouUrl + "WeChat/weChatSystem/deleteCheckpointFromCategory", {
            schoolId: schoolId,
            categoryId: categoryId,
            checkpointId: item,

        })
    );
}
export let getBluetoothDeviceByCategoryApi = (schoolId) => {
    return (
        Axios.post(baseUrl + "weChatSystem/getBluetoothDeviceByCategory", {
            schoolId: schoolId
        })
    );
}

export let getDutyBluetoothCategoryApi = (schoolId) => {
    return (
        Axios.post(baseUrl + "weChatSystem/getdutyCategory", {
            schoolId: schoolId
        })
    );
}


export let addDutyBluetoothDeviceApi = (macAddress, schoolId, categoryId) => {
    return (
        Axios.post(baseUrl + "weChatSystem/addDutyBluetoothDevice", {
            //categoryId
            macAddress: macAddress,
            schoolId: schoolId,
            categoryId: categoryId


        })
    );
}

export let deleteDutyBluetoothDeviceApi = (categoryId, schoolId, macAddress) => {
    return (
        Axios.post(baseUrl + "weChatSystem/deleteDutyBluetoothDevice", {
            categoryId: categoryId,
            schoolId: schoolId,
            macAddress: macAddress,
            invalid: 1
        })
    );
}
export let updateDutyBluetoothDeviceApi = (macAddress, schoolId, categoryId) => {
    return (
        Axios.post(baseUrl + "weChatSystem/updateDutyBluetoothDevice", {

            macAddress: macAddress,
            schoolId: schoolId,
            categoryId: categoryId,
            invalid: 0
        })
    );
}
export let getVisitorNameToday = (schoolId) => {
    return (
        Axios.get(backstageUrl + "Statistics/getVisitorNameToday", {
            params: {
                schoolId: schoolId,
            }
        })
    );
};

export let getVisitorNumRank = (schoolId) => {
    return (
        Axios.get(backstageUrl + "Statistics/getVisitorNumRank", {
            params: {
                schoolId: schoolId,
            }
        })
    );
};

export let getAllScoreDate = (departmentId) => {
    return (
        Axios.get(backstageUrl + "schoolSafetySupervisor/getAllScoreDate", {
            params: {
                departmentId: departmentId,
            }
        })
    );
}

export let getScoreDetailByDate = (departmentId, startDate, endDate) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getScoreDetailByDate", {
            departmentId: departmentId,
            startDate: startDate,
            endDate: endDate
        })
    );
    // let data = [{
    //     realname: "张三", 
    //     detail: [{
    //         name: "巡更",
    //         score: 10
    //     }, {
    //         name: "巡检",
    //         score: 10
    //     }, {
    //         name: "隐患", 
    //         score: 10
    //     }],
    //     total: 30
    // }, {
    //     realname: "李四", 
    //     detail: [{
    //         name: "巡更",
    //         score: 10
    //     }, {
    //         name: "巡检",
    //         score: 10
    //     }, {
    //         name: "隐患", 
    //         score: 10
    //     }],
    //     total: 30
    // }, {
    //     realname: "王五", 
    //     detail: [{
    //         name: "巡更",
    //         score: 10
    //     }, {
    //         name: "巡检",
    //         score: 10
    //     }, {
    //         name: "隐患", 
    //         score: 10
    //     }],
    //     total: 30
    // }]
    // let res = {
    //     data
    // }
    // let promise = new Promise((resolve) => {
    //     resolve(res);
    // })
    // return promise;


}

export let addZhiZhouItemBySchoolIdApi = (formData) => {
    return (
        Axios({
            method: 'post',
            url: userUrl + 'permission/addZhiZhouItemBySchoolId',
            headers: { "Content-Type": "multipart/form-data" },
            processData: false,
            data: formData
        })
    );
}

export let addZhiZhouRelationApi = (formData) => {
    return (
        Axios({
            method: 'post',
            url: userUrl + 'permission/addZhiZhouRelation',
            headers: { "Content-Type": "multipart/form-data" },
            processData: false,
            data: formData
        })
    );
}

export let addZhiZhouClassNmeBySchoolIdApi = (formData) => {
    return (
        Axios({
            method: 'post',
            url: userUrl + 'permission/addZhiZhouClassNmeBySchoolId',
            headers: { "Content-Type": "multipart/form-data" },
            processData: false,
            data: formData
        })
    );
}

export let addUserBySchoolIdApi = (formData) => {
    return (
        Axios({
            method: 'post',
            url: userUrl + 'permission/addUserBySchoolId',
            headers: { "Content-Type": "multipart/form-data" },
            processData: false,
            data: formData
        })
    );
}
export let getDutyWeekConditionForSelectApi = (schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getDutyWeekConditionForSelect", {
            schoolId: schoolId,
        })
    );
}
export let getDutyWeekConditionForSelectDetailApi = (schoolId, classId, more) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getDutyWeekConditionForSelectDetail", {
            schoolId: schoolId,
            classId: classId,
            more: more
        })
    );
}


//获得该学校所有值周所用的蓝牙 (值周)
export let getBlueToothForClassApi = (schoolId) => {
    return (

        Axios.get(baseUrl + "weChatSystem/getBlueToothForClass", {
            params: {
                schoolId: schoolId,
            }
        })

    );
}

// 查询所有没有配置过蓝牙的班级 (值周)
export let getNotBlueToothClassApi = (schoolId) => {
    return (

        Axios.get(baseUrl + "weChatSystem/getNotBlueToothClass", {
            params: {
                schoolId: schoolId,
            }
        })


    );
}



// *获得已和班级关联过的蓝牙 (值周)(值周)
export let getBlueToothClassUseApi = (schoolId) => {
    return (

        Axios.get(zhizhouUrl + "WeChat/weChatSystem/getBlueToothClassUse", {
            params: {
                schoolId: schoolId,
            }
        })


    );
}
export let DisplaygetAllDutyWeekCategoryApi = (schoolId) => {
    return (

        Axios.get(backstageUrl + "schoolMangement/DisplaygetAllDutyWeekCategory", {
            params: {
                schoolId: schoolId,
            }
        })


    );
}
export let getCheckPointForCategoryApi=(record) => {
    return (

        Axios.get(backstageUrl + "schoolMangement/DisgetCheckPointForCategory", {
            params: {
                schoolId: record.schoolId,
                categoryId: record.categoryId
            }
        })


    );
}

export let DisgetClassForBlueToothApi = (schoolId, record)  => {
    return (
        Axios.post(backstageUrl + "schoolMangement/DisgetClassForBlueTooth", {
            //categoryId
            macAddress: record.macAddress,
            schoolId: schoolId


        })
    );
}

//根据蓝牙编号获得该蓝牙绑定了那些地点 (值周)
export let getClassFromBlueToothApi = (schoolId, macAddress) => {
    return (
        Axios.post(zhizhouUrl + "WeChat/weChatSystem/getClassFromBlueTooth", {
            schoolId: schoolId,
            macAddress: macAddress,

        })
    );
}

//增加蓝牙配置 (值周)
export let updateBlueToothToClassApi = (schoolId, macAddress, classSelect) => {
    return (
        Axios.post(zhizhouUrl + "WeChat/weChatSystem/updateBlueToothToClass", {
            schoolId: schoolId,
            macAddress: macAddress,
            classSelect: classSelect

        })
    );
}

//增加蓝牙配置 (值周)
export let deleteBlueToothToClassApi = (schoolId, classs) => {
    return (
        Axios.post(zhizhouUrl + "WeChat/weChatSystem/deleteBlueToothToClass", {
            schoolId: schoolId,
            classSelect: classs


        })
    );
}
//获得生源网格信息
export let getGridStudentInfoApi = (schoolId) => {
    return (

        Axios.get(backstageUrl + "schoolSafetySupervisor/getGridStudentInfo", {
            params: {
                schoolId: schoolId,
            }
        })


    );
}


//获得四特学生信息

export let getSpecialGridStudentInfoApi = (schoolId) => {
    return (

        Axios.get(backstageUrl + "schoolSafetySupervisor/getSpecialGridStudentInfo", {
            params: {
                schoolId: schoolId,
            }
        })


    );
}

//获得非四特学生

export let getNotSpecialGridStudentInfoApi = (schoolId) => {
    return (

        Axios.get(backstageUrl + "schoolSafetySupervisor/getNotSpecialGridStudentInfo", {
            params: {
                schoolId: schoolId,
            }
        })


    );
}
//新增/更新四特学生
export let UpdateSpecialGridStudentInfoApi = (stulist) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/UpdateSpecialGridStudentInfo", {

            behavior: stulist.behavior,
            family: stulist.family,
            id: stulist.id,
            physique: stulist.physique,
            psychological: stulist.psychological,
            schoolId: stulist.schoolId,
            // grade:stulist.grade,
            studentName: stulist.studentName,


        })
    );
}
//删除四特学生 

export let deleteSpecialGridStudentInfoApi = (schoolId, id, studentName) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/deleteSpecialGridStudentInfo", {
            id: id,
            schoolId: schoolId,
            studentName: studentName,

        })
    );
}

//获取五老信息

export let getGridFiveOldStaffApi = (schoolId) => {
    return (

        Axios.get(backstageUrl + "schoolSafetySupervisor/getGridFiveOldStaff", {
            params: {
                schoolId: schoolId,
            }
        })


    );
}
//获得学校信息

export let getSchoolInfoApi = (schoolId) => {
    return (

        Axios.get(backstageUrl + "schoolSafetySupervisor/getSchoolInfo", {
            params: {
                schoolId: schoolId,
            }
        })


    );
}
//获得已有的巡更巡检地址中//选择配置值周地点
export let getUsableAddressAndMacAddressForZhizhouApi = (schoolId, type) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getUsableAddressAndMacAddressForZhizhou", {
            schoolId: schoolId,
            type: type

        })
    );
}
//获得所有值周检查点

export let getDutyWeekCheckpointApi = (schoolId, type) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getDutyWeekCheckpoint", {
            schoolId: schoolId,
            type: type

        })
    );
}
//获取未与值周地址关联的班级

export let getDutyWeekClassNotInRelationApi = (schoolId) => {
    return (

        Axios.get(backstageUrl + "schoolMangement/getDutyWeekClassNotInRelation", {
            params: {
                schoolId: schoolId,
            }
        })


    );
}

//值周查询
export let getAllZhiZhouClassApi = (schoolId) => {
    return (
        Axios.post(zhizhouUrl + "WeChat/weChatSystem/getAllZhiZhouClass", {
            schoolId: schoolId


        })
    );
}
export let getDutyWeekConditionForClassIdApi = (classid) => {
    return (
        Axios.post(zhizhouUrl + "WeChat/weChatSystem/getDutyWeekConditionForClassId", {
            id: classid


        })
    );
}
export let getDutyWeekConditionUserApi = (schoolId) => {
    return (
        Axios.post(baseUrl + "weChatSystem/getDutyWeekConditionUser", {
            schoolId: schoolId


        })
    );
}
export let getDutyWeekConditionTermApi = (schoolId, values) => {
    return (
        Axios.post(zhizhouUrl + "WeChat/weChatSystem/getDutyWeekConditionTerm", {

            className: values.classname,
            deadline: values.deadline,
            item: values.item,
            realName: values.realName,
            userId: values.userId,
            status: values.doneResult,
            schoolId: schoolId


        })
    );
}
export let getDutyWeekCurrentCategoryId = (schoolId) => {
    return (
        Axios.get(baseUrl + "weChatSystem/getDutyWeekCurrentCategoryId", {
            params: {
                schoolId: schoolId,
            }
        })
    );
}




// --------------------人脸机考勤

//获得所有进出人员信息

export let getAttendanceUserAndIsBindApi = (department) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getAttendanceUserAndIsBind", {
            department: department

        })
    );
}
//查询该学生绑定的信息

export let getAttendanceConnectionListApi = (id) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getAttendanceConnectionList", {
            id: id

        })
    );
}

//.删除一个进出人员信息
export let deleteAttendanceUserApi = (id) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/deleteAttendanceUser", {
            id: id

        })
    );
}

// ---------系统统计功能接口


export let getLatelyInfoApi = (parent, schoolLevel) => {
    return (
        Axios.post(userUrl + "EduInspect/getLatelyInfo1", {
            parent: parent,
            schoolLevel: schoolLevel
        })
    );
}

export let getAttendanceSearchChartDataApi = (schoolId, values) => {
    console.log(values.deadline)
    return (
        Axios.post(userUrl + "schoolMangement/getAttendanceSearchChartData", {
            department: schoolId,
            name: values.name,
            userNumber: values.userNumber,
            employer: values.employer,
            enter: values.enter,
            timePre: values.timePre,
            timeAfter: values.timeAfter,
            deviceName: values.deviceName,
            ip: values.ip,
            userType: values.userType
        })
    );
}

//-------------------------值周接口

export let getRealAndAllDutyWeekNumber = (departmentId, dateTime) => {
    return (
        Axios.get(backstageUrl + "Statistics/getRealAndAllDutyWeekNumber", {
            params: {
                departmentId: departmentId,
                dateTime: dateTime
            }
        })
    );
}

export let getDutyWeekQuestionNumberByDay = (departmentId, dateTime) => {
    return (
        Axios.get(backstageUrl + "Statistics/getDutyWeekQuestionNumberByDay", {
            params: {
                departmentId: departmentId,
                dateTime: dateTime
            }
        })
    )
}

export let getDutyWeekQuestionRank = (departmentId) => {
    return (
        Axios.get(backstageUrl + "Statistics/getDutyWeekQuestionRank", {
            params: {
                departmentId: departmentId
            }
        })
    )
}

export let getDutyWeekQuestionAddressRank = (departmentId) => {
    return (
        Axios.get(backstageUrl + "Statistics/getDutyWeekQuestionAddressRank", {
            params: {
                departmentId: departmentId
            }
        })
    )
}

export let getDutyWeekNumberToDay = (departmentId) => {
    return (
        Axios.get(backstageUrl + "Statistics/getDutyWeekNumberToDay", {
            params: {
                departmentId: departmentId
            }
        })
    )
}

// -----------------------多路径巡更接口

export let uploadMultiRoutePatrolAddress = (formData) => {
    return (
        Axios({
            method: 'post',
            url: backstageUrl + 'Multiroutepatrol/addMultiroutepatrolAddress',
            headers: { "Content-Type": "multipart/form-data" },
            processData: false,
            data: formData
        })
    );
}

export let getMultiroutepatrolAddressBySchoolId = (schoolId) => {
    return (
        Axios.get(backstageUrl + "Multiroutepatrol/getMultiroutepatrolAddressBySchoolId", {
            params: {
                schoolId: schoolId
            }
        })
    )
}

export let addMultiroutepatrolRoute = (schoolId, routeName, addressIdList) => {
    return (
        Axios.post(backstageUrl + "Multiroutepatrol/addMultiroutepatrolRoute", {
            schoolId: schoolId,
            routeName: routeName,
            addressId: addressIdList,
        })
    )
}

export let addMultiroutepatrolRouteName = (schoolId, routeName) => {
    return (
        Axios.post(backstageUrl + "Multiroutepatrol/addMultiroutepatrolRouteName", {
            schoolId: schoolId,
            routeName: routeName,
        })
    )
}
export let getMultiRoutePatrolNameById = (addressId) => {
    return (
        Axios.get(backstageUrl + "Multiroutepatrol/getMultiRoutePatrolNameById", {
            params: {
                addressId: addressId
            }
        })
    )
}

export let getMultiroutepatrolRouteApi = (schoolId) => {
    return (
        Axios.get(backstageUrl + "Multiroutepatrol/getMultiroutepatrolRoute", {
            params: {
                schoolId: schoolId
            }
        })
    );
};


// export let getMultiroutepatrolAddressIsRelationApi = (schoolId) => {
//     return (
//         Axios.get(backstageUrl + "Multiroutepatrol/getMultiroutepatrolAddressIsRelation", {
//             params: {
//                 schoolId: schoolId
//             }
//         })
//     );
// };

export let getMultiroutepatrolAddressByRouteIdApi = (schoolId, routeNameId) => {
    return (
        Axios.get(backstageUrl + "Multiroutepatrol/getMultiroutepatrolAddressByRouteId", {
            params: {
                schoolId: schoolId,
                routeNameId: routeNameId
            }
        })
    );
};

export let addOneMultiroutepatrolAddressApi = (routeNameId, addressIdAndChecPointIdList, schoolId) => {
    return (
        Axios.post(backstageUrl + "Multiroutepatrol/addOneMultiroutepatrolAddress", {
            routeNameId: routeNameId,
            addressIdAndChecPointIdList: addressIdAndChecPointIdList,
            schoolId: schoolId
        })
    );
};

export let updateRouteNameApi = (schoolId, routeName, routeNameId) => {
    return (
        Axios.get(backstageUrl + "Multiroutepatrol/updateRouteName", {
            params: {
                schoolId: schoolId,
                routeName: routeName,
                routeNameId: routeNameId
            }
        })
    );
};

//保存巡更路线
export let updatePatrolRouteApi = (data) => {
    return (
        Axios.post(backstageUrl + "Multiroutepatrol/updateMulPatrolRoute", {
            data: data,
        })
    );
}

export let deleteOneMultiroutepatrolAddressApi = (schoolId, routeNameId, addressName) => {
    return (
        Axios.post(backstageUrl + "Multiroutepatrol/deleteOneMultiroutepatrolAddress", {
            schoolId: schoolId,
            routeNameId: routeNameId,
            addressName: addressName
        })
    );
};
export let deleteRouteByRouteIdApi = (schoolId, routeNameId) => {
    return (
        Axios.post(backstageUrl + "Multiroutepatrol/deleteRouteByRouteId", {
            schoolId: schoolId,
            routeNameId: routeNameId,
        })
    );
};

//=====================================================================校外网格长信息===============================================
//得到校外网格长信息
export let getOutAdminGridApi = (schoolId) => {
    return (
        Axios.get(backstageUrl + "schoolSafetySupervisor/getOutAdminGrid", {
            params: {
                schoolId: schoolId,
            }
        })
    );
};

//更新校外网格长信息
export let updateOutAdminGridApi = (stulist) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/updateOutAdminGrid", {
            wgNumber: stulist.wgNumber,
            wgAdmin: stulist.wgAdmin,
            id: stulist.id,
            wgArea: stulist.wgArea,
            wgphone: stulist.wgPhone,
            schoolId: stulist.schoolId,
            addressDetail: stulist.addressDetail,
        })
    )

}


//删除校外网格长信息
export let deleteOutAdminGridApi = (schoolId, id, wgNumber) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/deleteUotAdminGrid", {
            id: id,
            schoolId: schoolId,
            wgNumber: wgNumber,
        })
    );
}


//删除五老人员信息
export let deleteFiveOldStaffGridApi = (schoolId, id, name) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/deleteFiveOldStaffGrid", {
            id: id,
            schoolId: schoolId,
            name: name,
        })
    );
}


export let updateFiveOldStaffGridApi = (stulist) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/updateFiveOldStaffGrid", {
            name: stulist.name,
            phone: stulist.phone,
            id: stulist.id,
            county: stulist.county,
            identity: stulist.identity,
            gridContactPerson: stulist.gridContactPerson,
            gridContactPersonPhone: stulist.gridContactPersonPhone,
            schoolId: stulist.schoolId,
            addressDetail: stulist.addressDetail,
        })
    )
}




export let getLogOutApi = () => {
    return (
        Axios.post(userUrl + "SystemLogin/logOut", {

        })
    );
};



//大屏伪登录
// export let loginBigScreenApi = (username, password) => {
//     return (
//         Axios.get(preUrl + "StatisticsForAllSchool/login", {
//             params: {
//                 username: username,
//                 password: password
//             }    
//         })
//     );
// };Api



//批量导入巡检班组信息
export let batchImportInspectClassApi = (formData) => {
    return (
        Axios({
            method: 'post',
            url: backstageUrl + 'basicDataImport/batchImportInspectClass',
            headers: { "Content-Type": "multipart/form-data" },
            processData: false,
            data: formData
        })
    );
}

//批量导入巡检地址和巡检项目关联
export let batchImportInspectAddressAndInspectItemApi = (formData) => {
    return (
        Axios({
            method: 'post',
            url: backstageUrl + 'basicDataImport/batchImportInspectAddressAndInspectItem',
            headers: { "Content-Type": "multipart/form-data" },
            processData: false,
            data: formData
        })
    );
}


//批量导入巡检计划
export let batchImportInspectPlanApi = (formData) => {
    return (
        Axios({
            method: 'post',
            url: backstageUrl + 'basicDataImport/batchImportInspectPlan',
            headers: { "Content-Type": "multipart/form-data" },
            processData: false,
            data: formData
        })
    );
}


//批量删除用户
export let deleteUserInfoAllApi = (departmentId) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteUserInfoAll", {
            departmentId: departmentId
        })
    );
}


//获取学校信息
export let getSchoolInfoByNameApi = (name) => {
    return (
        Axios.get(backstageUrl + "schoolMangement/getSchoolInfoByName", {
            params: {
                name: name
            }
        })
    );
};

//获取中心学校的子学校信息
export let getChildrenSchoolInfoBySchoolIdApi = (schoolId) => {
    return (
        Axios.get(backstageUrl + "schoolMangement/getChildrenSchoolInfoBySchoolId", {
            params: {
                schoolId: schoolId
            }
        })
    );
};


//添加值周类别
export let addDutyWeekCategoryApi = (categoryList) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/addDutyWeekCategory", {
            id: 0,
            category: categoryList.name,
            invalid: 0,
            schoolId: categoryList.department,
        })
    )
}
//添加值周内容
export let addDutyWeekContentApi =(contentList)=>{
    return(
        Axios.post(backstageUrl+"schoolMangement/addDutyWeekContent", {
            item: contentList.name,
            schoolId:contentList.department
        })
    )
}
//添加值周地点
export let addDutyWeekPlaceApi =(placeList)=>{
    return(
        Axios.post(backstageUrl+"schoolMangement/addDutyWeekPlace", {
            schoolId:placeList.department,
            classname: placeList.name,
        })
    )
}

//查找值周类别
export let getAllDutyWeekCategoryApi = (schoolId) => {
    return (
        Axios.get(backstageUrl + "schoolMangement/getAllDutyWeekCategory", {
            params: {
                schoolId: schoolId
            }
        })
    )
}
//获取值周内容
export let getAllDutyWeekContentApi = (schoolId) => {
    return (
        Axios.get(backstageUrl + "schoolMangement/getAllDutyWeekContent", {
            params: {
                schoolId: schoolId
            }
        })
    )
}
//获取值周地点
export let getAllDutyWeekPlaceApi = (schoolId) => {
    return (
        Axios.get(backstageUrl + "schoolMangement/getAllDutyWeekPlace", {
            params: {
                schoolId: schoolId
            }
        })
    )
}

//删除值周类别
export let deleteDutyWeekCategoryApi = (schoolId, category) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteDutyWeekCategory", {
            schoolId: schoolId,
            category: category
        })
    )
}
//删除值周内容
export let deleteDutyWeekContentApi = (schoolId, item) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteDutyWeekContent", {
            schoolId: schoolId,
            item: item
        })
    )
}
//删除值周地点
export let deleteDutyWeekPlaceApi = (schoolId, classname) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/deleteDutyWeekPlace", {
            schoolId: schoolId,
            classname: classname
        })
    )
}

//更新值周类别
export let updateDutyWeekCategoryApi = (schoolId, newCategory, oldCategory) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/updateDutyWeekCategory", {
            schoolId: schoolId,
            newCategory: newCategory,
            oldCategory: oldCategory
        })
    )
}
//更新值周内容
export let updateDutyWeekContentApi = (schoolId, newitem, olditem) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/updateDutyWeekContent", {
            schoolId: schoolId,
            newitem: newitem,
            olditem: olditem
        })
    )
}
//更新值周地点
export let updateDutyWeekPlaceApi = (schoolId, newclassname, oldclassname) => {
    return (
        Axios.post(backstageUrl + "schoolMangement/updateDutyWeekPlace", {
            schoolId: schoolId,
            newclassname: newclassname,
            oldclassname: oldclassname
        })
    )
}



export let deleteInspectPlanByClassIdApi = (data) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/deleteInspectPlanByClassId", {
            data: data
        })
    );
}


export let getSchoolSystemGridInfoApi = (schoolId) => {
    return (
        Axios.get(userUrl + "eduDepartmentManagement/getSchoolSystemGridInfo", {
            params: {
                schoolId: schoolId,
            }
        })


    );
}

//大屏接口安全
export let getScreenSecretApi = (name, key) => {
    return (
        Axios.post(backstageUrl + "bigscreenSecurity/getScreenSecret", {
            name: name,
            key: key
        })
    );
}
//大屏接口安全 -- 密钥对比
export let compareSecretAndExpireTimeApi = (secret) => {
    return (
        Axios.post(backstageUrl + "bigscreenSecurity/compareSecretAndExpireTime", {
            secret: secret
        })
    );
}



export let PushRecordSearchApi = (name, pushUserName, pushType, startTime, endTime, pushStatus) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/PushRecordSearch", {
            name: name,
            pushUserName: pushUserName,
            pushType: pushType,
            startTime: startTime,
            endTime: endTime,
            pushStatus: pushStatus
        })
    );
}


export let getDepartmentApi = (id) => {
    return (
        Axios.get(userUrl + "eduDepartmentManagement/getDepartment", {
            params: {
                id: id,
            }
        })


    );
}


export let deleteAllGridStudentBySchoolIdApi = (schoolId) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/deleteAllGridStudentBySchoolId", {
            schoolId:schoolId 
        })
    );
}
export let getDutyWeekInfoApi = (departmentId, dateTime)=>{
    return(
        Axios.get(baseUrl+"/WeChat/Statistics/getDutyWeekInfo", {
            params:{
                departmentId:departmentId,
                dateTime:dateTime
            }
        })
    )
}



export let getSecurityDataBySchool = (schoolId, startTime, endTime) => {
    return (
        Axios.post(backstageUrl + "edudailystatistics/getSecurityDataBySchool", {
            schoolId:schoolId,
            startTime:startTime,
            endTime:endTime
        })
    );
}

export let getSchoolInformationBySchool = (schoolId) => {
    return (
        Axios.get(backstageUrl + "edudailystatistics/getSchoolInformationBySchool", {
            params: {
                schoolId: schoolId,
            }
        })
    );
}

export let getAvgAndMaxSecurityData = (schooltype, startTime, endTime) => {
    return (
        Axios.post(backstageUrl + "edudailystatistics/getAvgAndMaxSecurityData ", {
            schooltype:schooltype,
            startTime:startTime,
            endTime:endTime
        })
    );
}

export let getXunchaConditionDetail = (superviseId, superviseRelationId) => {
    return (
        Axios.post(backstageUrl + "edudailystatistics/getXunchaConditionDetail ", {
            superviseId:superviseId,
            superviseRelationId:superviseRelationId,
        })
    );
}

export let getDailyConditionDetailApi = (suddenSuperviseId) => {
    return (
        Axios.post(backstageUrl + "edudailystatistics/getDailyConditionDetail ", {
            suddenSuperviseId:suddenSuperviseId
        })
    );
}


export let getDailyDealDetailApi = (suddenSuperviseId) => {
    return (
        Axios.post(backstageUrl + "edudailystatistics/getDailyDealDetail ", {
            suddenSuperviseId:suddenSuperviseId
        })
    );
}

export let getXunchaDealDetail = (superviseId, superviseRelationId) => {
    return (
        Axios.post(backstageUrl + "edudailystatistics/getXunchaDealDetail ", {
            superviseId:superviseId,
            superviseRelationId:superviseRelationId,
        })
    );
}

export let getSafetySceneByCategory = (educationId, schooltype, categoryId, startTime, endTime) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getSafetySceneByCategory", {
            educationId: educationId,
            schooltype: schooltype,
            categoryId: categoryId,
            startTime: startTime,
            endTime: endTime
        })
    );
}

export let getSchoolTypeNumByEduId = (parent) => {
    return (
        Axios.post(backstageUrl + "edudailystatistics/getSchoolTypeNumByEduId", {
            parent: parent,
        })
    );
}

export let getSecurityDataByEduId = (educationId, startTime, endTime) => {
    return (
        Axios.post(backstageUrl + "edudailystatistics/getSecurityDataByEduId", {
            educationId: educationId,
            startTime: startTime,
            endTime: endTime
        })
    );
}

export let getAvgAndMaxSecurityDataByCounty = (startTime, endTime) => {
    return (
        Axios.post(backstageUrl + "edudailystatistics/getAvgAndMaxSecurityDataByCounty", {
            startTime: startTime,
            endTime: endTime
        })
    );
}

export let getCountySecurityDataRank = (startTime, endTime, departmentId) => {
    return (
        Axios.post(backstageUrl + "edudailystatistics/getCountySecurityDataRank", {
            educationId: 1,
            schooltype: undefined,
            startTime: startTime,
            endTime: endTime,
            departmentId: departmentId
        })
    );
}

export let getTopFiveSchoolComprehensivePointsRankByEduId = (educationId, schooltype, startTime, endTime) => {
    return (
        Axios.post(backstageUrl + "edudailystatistics/getTopFiveSchoolComprehensivePointsRankByEduId", {
            educationId: educationId,
            schooltype: schooltype,
            startTime: startTime,
            endTime: endTime,
        })
    );
}

export let getLastFiveSchoolComprehensivePointsRankByEduId = (educationId, schooltype, startTime, endTime) => {
    return (
        Axios.post(backstageUrl + "edudailystatistics/getLastFiveSchoolComprehensivePointsRankByEduId ", {
            educationId: educationId,
            schooltype: schooltype,
            startTime: startTime,
            endTime: endTime,
        })
    );
}
export let getSelectTitleByDepartmentApi = (departmentId) => {
    return (
        Axios.get(dailyUrl + "title/selectTitleByDepartment", {
            params: {
                departmentId: departmentId,
            }
        })
    );
}
export let getRelationtApi = (departmentId) => {
    return (
        Axios.get(dailyUrl + "relation/getRelation", {
            params: {
                departmentId: departmentId,
            }
        })
    );
}
export let addRelationApi = (Info) => {
    return (
        Axios.post(dailyUrl + "relation/addRelation",
            Info
        )
    );
}

export let getSchoolSecurityDataAndRank = (educationId, schoolLevel, startTime, endTime, schoolname) => {
    return (
        Axios.post(backstageUrl + "edudailystatistics/getSchoolSecurityDataAndRank ", {
            educationId: educationId,
            schoolLevel: schoolLevel,
            startTime: startTime,
            endTime: endTime,
            schoolname: schoolname
        })
    );
}

export let allAdjustUserApi = (current, pageSize, name, department, identity) => {
    return (
        Axios.post(userUrl + "AccountManagement/getAllAdjustUser", {
            current: current,
            pageSize: pageSize,
            name: name,
            department: department,
            identity: identity
        })
    );
}

export let getUserAdjustSchool = () => {
    return (
        Axios.post(userUrl + "AccountManagement/getUserAdjustSchool")
    );
}

export let getRootDepartmentApi = () => {
    return (
        Axios.get(userUrl + "schoolMangement/getRootDepartment")
    );
}

export let countBluetoothTypeNumberBySchoolIdApi = (parentId) => {
    return (
        Axios.get(userUrl + "schoolMangement/countBluetoothTypeNumberBySchoolId", {
            params: {
                parentId
            }
        })
    );
}

export let getUserIdentity = () => {
    return (
        Axios.post(userUrl + "AccountManagement/getUserIdentity")
    );
}

export let updateAdjustUser = (id, username, preidentity, params) => {
    return (
        Axios.post(userUrl + "AccountManagement/updateAdjustUser", {
            userId: id,
            username: username,
            identityString: preidentity,
            department: params.department
        })
    );
}

export let getThemeBydepartmentApi = (schoolId) => {
    return (
        Axios.get(questionnaireUrl + "questionnaireFormal/getThemeByDepartment", {
            params: {
                schoolId,
            }
        })
    );
}

export let getEpidemicThemeByDepartmentApi = (schoolId) => {
    return (
        Axios.get(questionnaireUrl + "epidemicFormal/getEpidemicThemeByDepartment", {
            params: {
                schoolId,
            }
        })
    );
}

export let deleteThemeApi = (formKey) => {
    return (
        Axios.get(questionnaireUrl + "questionnaireFormal/removeTheme", {
            params: {
                formKey
            }
        })
    )
}

export let removeEpidemicThemeApi = (formKey) => {
    return (
        Axios.get(questionnaireUrl + "epidemicFormal/removeEpidemicTheme", {
            params: {
                formKey
            }
        })
    )
}

export let releaseThemeApi = ({ formKey, startTime, endTime }) => {
    return (
        Axios.get(questionnaireUrl + "questionnaireFormal/releaseTheme", {
            params: {
                formKey,
                startTime,
                endTime
            }
        })
    )
}

export let releaseEpidemicThemeApi = ( formKey ) => {
    return (
        Axios.get(questionnaireUrl + "epidemicFormal/releaseEpidemicTheme", {
            params: {
                formKey
            }
        })
    )
}

export let stopThemeApi = (formKey) => {
    return (
        Axios.get(questionnaireUrl + "questionnaireFormal/stopPublishTheme", {
            params: {
                formKey
            }
        })
    )
}

export let queryItemsApi = (formKey) => {
    return (
        Axios.get(questionnaireUrl + "itemFormal/queryItems", {
            params: {
                formKey
            }
        })
    )
}

export let getStatisticalAnswerAPi = (formKey) => {
    return (
        Axios.get(questionnaireUrl + "recordFormal/statisticalAnswer", {
            params: {
                formKey
            }
        }
        )
    )
}

export let getReleaseThemeNumApi = (schoolId, displayType) => {
    return (
        Axios.get(questionnaireUrl + "questionnaireFormal/getReleaseThemeNum", {
            params: {
                schoolId,
                displayType
            }
        }
        ))
}

export let getReleaseEpidemicThemeNumApi = (schoolId, displayType) => {
    return (
        Axios.get(questionnaireUrl + "epidemicFormal/getReleaseEpidemicThemeNum", {
            params: {
                schoolId,
                displayType
            }
        }
        ))
}

export let queryRecordByFormKeyApi = (formKey) => {
    return (
        Axios.get(questionnaireUrl + "recordFormal/queryRecordByFormKey", {
            params: {
                formKey
            }
        })
    )
}

//学校信息-简介编辑
export let updateSchoolProfilesApi=(department)=>{
    return(
        Axios.post(userUrl + "schoolMangement/updateSchoolProfiles", department)
    )
}

//学校信息-类型编辑
export let updateSchoolLevelApi=(department)=>{
    return(
        Axios.post(userUrl + "schoolMangement/updateSchoolLevel", department)
    )
}

//学校信息-图片上传（阿里云服务器）
export let uploadSchoolImgApi=(file)=>{
    return(
        Axios.post(
            userUrl + "schoolMangement/uploadSchoolImg", 
            file, 
            {
                headers: { "Content-Type": "multipart/form-data" },
            }
        )
    )
}

//学校信息-图片路径存储（数据库）
export let addSchoolImgApi=(department)=>{
    return(
        Axios.post(
            userUrl+"schoolMangement/addSchoolImg",
            department
        )
    )
}

//学校信息-简介、学校类型和图片获取
export let getSchoolProfilesAndImgAndSchoolLevelApi=(schoolId)=>{
    return(
        Axios.get(
            backstageUrl+"schoolMangement/getSchoolProfilesAndImgAndSchoolLevel",
            {
                params:{
                    schoolId
                }
            }
        )
    )
}

//学校信息-图片路径删除（数据库）
export let deleteSchoolImgApi=(department)=>{
    return(
        Axios.post(
            userUrl+"schoolMangement/deleteSchoolImg",
            department
        )
    )
}

//学校信息-图片删除（阿里云服务器）
export let unloadSchoolImgApi=(deleteFile)=>{
    return(
        Axios.post(
            userUrl+"schoolMangement/unloadSchoolImg",
            deleteFile
        )
    )
}
export let getAllsafetysceneApi = () => { 
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getAllSafetyScene", {
            
        })
    );
}


//获取所有项目类别
export let getAllExistCategoryApi = () => {
    return (
        Axios.post(backstageUrl + "schoolMangement/getAllExistCategory", {
        })
    );
}

//根据条件查询所有学校安全现场信息
export let getAllSafetySceneByConditionApi = (values) => {
    return (
        Axios.post(backstageUrl + "schoolSafetySupervisor/getAllSafetySceneByCondition", {
            address: values.address,
            categoryId: values.categoryId, //array
            safetyLevel: values.safetyLevel,
            name: values.reporterName,
            status: values.status,
            reportStartDate: values.reportStartDate,
            reportEndDate: values.reportEndDate,
            dealStartDate: values.dealStartDate,
            dealEndDate: values.dealEndDate,
            dealName: values.dealName,
            departmentName: values.departmentName
        })
    );
}

